Grokking System Design Fundamentals
Rate this course
Ask Author
Contribute
Back to course home

80% completed

Vote For New Content
System Design Fundamentals
Introduction to System Design
Load Balancing
Introduction to Load Balancing
Load Balancing Algorithms
Uses of Load Balancing
Load Balancer Types
Stateless vs. Stateful Load Balancing
High Availability and Fault Tolerance
Scalability and Performance
Challenges of Load Balancers
API Gateway
Introduction to API Gateway
Usage of API gateway
Advantages and disadvantages of using API gateway
Key Characteristics of Distributed Systems
Scalability
Availability
Latency and Performance
Concurrency and Coordination
Monitoring and Observability
Resilience and Error Handling
Fault Tolerance vs. High Availability
Network Essentials
HTTP vs. HTTPS
TCP vs. UDP
HTTP: 1.0 vs. 1.1 vs 2.0 vs. 3.0
URL vs. URI vs. URN
Domain Name System (DNS)
Introduction to DNS
DNS Resolution Process
DNS Load Balancing and High Availability
Caching
Introduction to Caching
Why is Caching Important?
Types of Caching
Cache Replacement Policies
Cache Invalidation
Cache Read Strategies
Cache Coherence and Consistency Models
Caching Challenges
Cache Performance Metrics
CDN
What is CDN?
Origin Server vs. Edge Server
CDN Architecture
Push CDN vs. Pull CDN
Data Partitioning
Introduction to Data Partitioning
Partitioning Methods
Data Sharding Techniques
Benefits of Data Partitioning
Common Problems Associated with Data Partitioning
Proxies
What is a Proxy Server?
Uses of Proxies
VPN vs. Proxy Server
Redundancy and Replication
What is Redundancy?
What is Replication?
Replication Methods
Data Backup vs. Disaster Recovery
CAP & PACELC Theorems
Introduction to CAP Theorem
Components of CAP Theorem
Trade-offs in CAP Theorem
Examples of CAP Theorem in Practice
Beyond CAP Theorem
System Design Trade-offs in Interviews
Databases (SQL vs. NoSQL)
Introduction to Databases
SQL Databases
NoSQL Databases
SQL vs. NoSQL
ACID vs BASE Properties
Real-World Examples and Case Studies
SQL Normalization and Denormalization
In-Memory Database vs. On-Disk Database
Data Replication vs. Data Mirroring
Database Federation
Indexes
What are Indexes?
Types of Indexes
Bloom Filters
Introduction to Bloom Filters
Benefits & Limitations of Bloom Filters
Variants and Extensions of Bloom Filters
Applications of Bloom Filters
Long-Polling vs. WebSockets vs. Server-Sent Events
Difference Between Long-Polling, WebSockets, and Server-Sent Events
Quorum
What is Quorum?
Heartbeat
What is Heartbeat?
Checksum
What is Checksum?
Uses of Checksum
Leader and Follower
What is Leader and Follower Pattern?
Security
What is Security and Privacy?
What is Authentication?
What is Authorization?
Authentication vs. Authorization
OAuth vs. JWT for Authentication
What is Encryption?
What are DDoS Attacks?
Introduction to Messaging System
Introduction to Kafka
Messaging patterns
Popular Messaging Queue Systems
RabbitMQ vs. Kafka vs. ActiveMQ
Scalability and Performance
What is a Distributed File System?
Architecture of a Distributed File System
Key Components of a DFS
Batch Processing vs. Stream Processing
XML vs. JSON
Synchronous vs. Asynchronous Communication
Push vs. Pull Notification Systems
Microservices vs. Serverless Architecture
Message Queues vs. Service Bus
Stateful vs. Stateless Architecture
Event-Driven vs. Polling Architecture
Quiz
OAuth vs. JWT for Authentication

OAuth and JWT (JSON Web Tokens) are both widely used in the field of web security, but they serve different purposes and are often used in conjunction with each other rather than in opposition. Understanding their distinct roles is key to implementing effective authentication and authorization strategies in web applications.

OAuth

Definition

  • OAuth is an open standard for access delegation, commonly used as a way for users to grant websites or applications access to their information on other websites but without giving them the passwords.

Characteristics

  • Delegation Protocol: OAuth is not an authentication protocol but a secure delegation mechanism. It's used to grant permissions to a third-party to access user data without exposing user credentials.
  • Tokens: It uses access tokens for authorization.
  • Use Cases: Commonly used to allow users to log in to a third-party application using their credentials from a service like Google, Facebook, or Twitter.

Example

  • A user logs into a third-party app using their Google account. OAuth allows the app to access some of the user’s Google account data, as authorized, without the need to share Google account credentials with the third-party app.

JWT (JSON Web Tokens)

Definition

  • JWT is a token format used in authorization and information exchange. It’s a JSON object encoded as a string, which is digitally signed, and optionally encrypted.

Characteristics

  • Authentication & Information Exchange: JWT can be used for both authentication and secure data exchange.
  • Structure: A JWT typically consists of three parts: Header, Payload, and Signature.
  • Stateless: JWTs are self-contained, allowing stateless authentication, and are typically used in RESTful APIs.
  • Use Cases: Often used for token-based authentication systems.

Example

  • After a user logs in, the server creates a JWT with user information, signs it, and sends it back to the client. The client then uses this JWT to access protected resources by sending it with HTTP requests.

Key Differences

  1. Purpose:

    • OAuth: A protocol for authorization. It allows one service to utilize another service’s user authentication without the need for credentials.
    • JWT: A format for securely transmitting information. It can be used for authentication and information exchange.
  2. Usage in Authentication/Authorization:

    • OAuth: Used to grant access to user data and services from one site to another.
    • JWT: Often used as the format of the access token in OAuth, but can also be used independently for authentication and information transfer.
  3. State:

    • OAuth: Typically relies on server-side storage to keep track of the issued tokens.
    • JWT: Stateless; it contains all the necessary information within the token.
  4. Security:

    • OAuth: Security depends on the specific implementation but generally relies on SSL/TLS for security during token exchange.
    • JWT: The token itself is secured by its digital signature.

Conclusion

  • Complementary Technologies: In many implementations, OAuth uses JWT as the format for its tokens. OAuth manages the authorization process, and JWT provides a secure token format.
  • Use JWT for: Securely transmitting information between parties and stateless authentication.
  • Use OAuth for: Delegating access to user data to third-party applications without exposing user credentials.

Understanding when to use each and how they can work together is crucial for designing secure and efficient authentication and authorization mechanisms in modern web applications.

Authentication vs. Authorization
What is Encryption?
Mark as Completed

On this page

OAuth

Definition

Characteristics

Example

JWT (JSON Web Tokens)

Definition

Characteristics

Example

Key Differences

Conclusion